{echo:JS::import('dialog?skin=brief');}
{echo:JS::import('dialogtools');}
{echo:JS::import('form');}
<form action="" method="post">
<div class="tools_bar clearfix">
    <!-- <a class="icon-checkbox-checked icon-checkbox-unchecked" href="javascript:;" onclick="tools_select('id[]',this)" title="全选" data="true"> 全选 </a> -->
    <!-- <a  class="icon-remove-2" href="javascript:;" onclick="tools_submit({action:'{url:/customer/customer_del}',msg:'删除后无法恢复，你真的删除吗？'})" title="删除"> 删除</a> -->
    <!-- <a href='{url:/customer/customer_edit}' class="icon-plus" > 添加</a> -->
    <a class="icon-delicious" href="{url:/customer/sq_list}"> 全部</a>
    <span class="fr"><a href='javascript:;' id="condition" class="icon-search" style="" > 筛选条件</a><input id="condition_input" type="hidden" name="condition" value="{$condition}"></span>
</div>
<table class="default" >
    <tr>
        <!-- <th style="width:30px">选择</th> -->
        <th>申请人</th>
        <th>申请类型</th>
        <th>直推人数</th>
        <th>团队业绩</th>
        <th>申请时间</th>
        <th>审核时间</th>
        <th>审核人</th>
        <th>操作</th>

    </tr>
    {query:name=sq_list as c,user as u where=c.user_id eq u.id and $where id=$obj page=1 order=sq_id desc}
        <!-- <tr><td style="width:30px"><input type="checkbox" name="id[]" value="{$item['id']}"></td> -->
        <td>{$item['name']}</td>
       	<td>
       	{echo:Common::getShenfenName($item['sq_lx'])}
       	</td>
       	<td>{$item['u_tjrs']}</td>
       	<td>{$item['tuan_yj']}</td>
        <td>{$item['sq_time']}</td>
        <td>{$item['sh_time']}</td>
        <td>{$item['sh_user']}</td>
        <td>
        	<!-- 
        	<a class="icon-pencil" href="javascript:dpAction({$item['sq_id']});"> 审批</a>
        	-->
        	{if:$item['is_ok']==0}
        	<a class="btn" href="{url:/customer/sq_do/sq_id/$item[sq_id]/is_ok/1}" onclick="return confirm('确定要执行此操作吗')">通过</a> 
            <a class="btn" href="{url:/customer/sq_do/sq_id/$item[sq_id]/is_ok/2}" onclick="return confirm('确定要执行此操作吗')">拒绝</a>
            {elseif:$item['is_ok']==1}
            	已同意
            {elseif:$item['is_ok']==2}
            	已拒绝
            {/if}
        </td>
        </tr>
    {/query}
</table>
</form>
<div class="page_nav">
{echo:$obj->pageBar()}
</div>


<script type="text/javascript">
	var form =  new Form();
	$("#condition").on("click",function(){
	$("body").Condition({input:"#condition_input",okVal:'高级搜索',callback:function(data){tools_submit({action:'{url:/customer/sq_list}',method:'get'});},data:{'name':{name:'申请人'},sq_lx:{name:'申请类型',values:{1:'服务中心',2:'分公司'}},is_ok:{name:'状态',values:{0:'待处理',1:'已通过',2:'拒绝'}},sq_time:{name:'申请时间'},sh_time:{name:'审核时间'}
	}});
	});

   function dpAction(id)
    {
	   art.dialog.open("{url:/customer/dp_view/id/}"+id,{id:'dp-dialog',title:"查看审批",width:620});
        //if(lx==2)art.dialog.open("{url:/customer/dp_view/id/}"+id,{id:'dp-dialog',title:"查看审批",width:620});
        //if(lx==3)art.dialog.open("{url:/customer/agent_view/id/}"+id,{id:'dp-dialog',title:"查看审批",width:620});
    }
    function close_dialog()
    {
        art.dialog({id:"dp-dialog"}).close();
        tools_reload();
    }
</script>

